﻿// *********************************************************************
// [DCOM Productions]
// [Copyright (C) DCOM Productions All rights reserved.]
// *********************************************************************

namespace BitFlex {
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public static class OperatingSystemExtensions {
        /// <summary>
        /// Gets the Environment Platform of the current Operating System Environment
        /// </summary>
        /// <param name="env">The current environment</param>
        /// <returns>Returns the Environment Platform</returns>
        public static OperatingSystemPlatform GetEnvironmentPlatform(this OperatingSystem os) {
            switch (IntPtr.Size) {
                case 8:
                    return OperatingSystemPlatform.x64;
                case 4:
                    return OperatingSystemPlatform.x86;
                default:
                    return OperatingSystemPlatform.Unknown;
            }
        }
    }
}
